<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		

		<title>刷卡列表</title>

		<link rel="stylesheet"
			href="<%=request.getContextPath()%>/css/common.css" type="text/css" />
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/js/N13FormValidation-2.js"></script>
		<script type='text/javascript'
			src='<%=request.getContextPath()%>/dwr/interface/cardAction.js'></script>
		<script type='text/javascript'
			src='<%=request.getContextPath()%>/dwr/engine.js'></script>
		<script type='text/javascript'
			src='<%=request.getContextPath()%>/dwr/util.js'></script>
		<script type="text/javascript">
		
		//将刷卡的学号传给另一个页面
		function getStudentNo(id){
		window.top.frames['apt'].frames['maintain'].document.getElementById("student_info").value = id;
		window.top.frames['apt'].frames['maintain'].stu_BasicInfo();
		}	
	//存储刷卡记录		
var callback = function liststudentno(callbackno)
{	$('notExist').style.display = 'none';
	if(callbackno == null){
		$('notExist').style.display = '';
		return;
	}
	var slist = callbackno;	
	document.getElementById("studentno").value=slist[0];
	document.getElementById("studentname").value=slist[1];
	swipcard.submit();
}
</script>
<script type="text/javascript" for="DMSCardCtrl" event="OnSwipCard(codeID, carno, usercode,time)">
		{	
			document.getElementById("cardno").value=carno;		
			cardAction.findStudentByCardid(carno,callback);				
		}		
	</script>
	 <object id="DMSCardCtrl" classid="CLSID:C90A7370-60BA-45AE-B0DF-12D8564C4868"></object>
	
		<s:head />
	</head>

	<body  >
		<div id="page_container">
			<div id="content">
				<h2>
					刷卡列表
				</h2>
				<br />
				<s:form id="swipcard" name="swipcard"
					action="insertSwipcard.action" method="post"
					theme="simple" >
							<td class="td_right">
								<s:hidden id="cardno" name="sc.cardno" />
								<s:hidden id="studentno" name="sc.studentno" />
								<s:hidden id="studentname" name="sc.studentname" />
							</td>
			<label id="notExist" style="display:none;color:'red';font-weight:bolder;" >该卡信息不存在!</label>
							
			<table class="table_common sortable table_list_style" width="600px" rowclass="row_odd,row_even">
				<tr>
					
					<th>
						学号
					</th>
					<th>
						姓名
					</th>
					</tr>
					<tr>
					<th>
						时间
					</th>
					<th>
						删除
					</th>
				</tr>
				<s:iterator value="sclist" status="st">
					<s:hidden value="id" />
					<s:hidden id="studentno"/>
					
					<s:if test="#st.odd==true">
					<tr class="row_odd">
					</s:if>
					<s:else><tr class="row_even">
					</s:else>
					
					<td>
						<a  href="#" onclick="javascript: getStudentNo('${studentno}');">
						<s:property value="studentno" /></a>
					</td>
					<td>
						<s:property value="studentname" />
					</td>
					<s:if test="#st.odd==true">
					<tr class="row_odd">
					</s:if>
					<s:else><tr class="row_even">
					</s:else>
					<td>
					<s:date name="swiptime" format="yyyy-MM-dd hh:mm" />
						
					</td>
					<td>
						<a
							href="swipcarddelete.action?swipcardid=${id}"
							onclick="javascript: return window.confirm('确定删除吗?')"><img
								src="<%=request.getContextPath()%>/images/083.gif" /> </a>
					</td>
					
                      
				</s:iterator>
			</table>
				</s:form>
			</div>
		</div>
	</body>
</html>
